<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<div class="t_bar"><span class="color_red">*</span>项目进度计划（说明项目进度，包括实施方案、实施地点、阶段性成果等内容）</div>
<table  id="tblMileStones" style="width: 100%"  class="table01" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;table-layout: fixed; word-break: break-all; word-wrap: break-word;">
    <thead >
    <tr style="border:1px solid #B7D1E6">
        <th class="TblHead" align="center"  width="30px">选择</th>
        <th class="TblHead" align="center"  width="30px">序号</th>
        <th class="TblHead" align="center"  width="125px">开始日期</th>
        <th class="TblHead" align="center"  width="125px">结束日期</th>
        <th class="TblHead" align="center"  >年度实施内容和考核指标(限500字)</th>
    </tr>
    </thead>
    <tbody id="tab">
    <tr style="display:none">
        <td>&nbsp;
            <input type="radio" class="radiobutton" name="selMileStones" >
        </td>
        <td align="center">&nbsp;
            <span name="milestones|milestone[0]@seq_no" >[index]</span>
        </td>
        <td align="center">&nbsp;
            <input  id="milestone_start_date_[0]" name="milestones|milestone[0]|start_date" label="开始日期"value="" class=" required input_text date  dateCompare:milestone_end_date_[0] dateCompareAfterE:milestone_start_date_[0]:start_date" style="width:70px" label="开始日期" />
        </td>
        <td align="center">&nbsp;<input  id="milestone_end_date_[0]" name="milestones|milestone[0]|end_date" label="结束日期" value="" class=" required input_text date dateCompareBeforeE:milestone_end_date_[0]:end_date " style="width:70px" label="结束日期" /> </td>
        <td>&nbsp;<textarea name="milestones|milestone[0]|content" class="input_textarea required maxlength:500" label="年度实施内容和考核指标"  rows=5 cols=91></textarea>
            <input type="hidden" name="milestones|milestone[0]|content_hidden" />
        </td>
    </tr>


    <c:set value="0" var="index" scope="page"/>
    <x:forEach select="$xmlData/data/milestones/milestone" var="milestone">

        <c:choose>
            <c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
            <c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
        </c:choose>
        <tr >
            <td>&nbsp;
                <input type="radio" class="radiobutton" name="selMileStones" >
            </td>
            <td align="center">
                <span   name="milestones/milestone[${flag}${index}]@seq_no" ><x:out select="$milestone/@seq_no"/></span>
            </td>
            <td align="center">&nbsp;
                <c:set var="start_date" scope="page"><x:out select="$milestone/start_date"/></c:set>
                <input  id="milestone_start_date_[${flag}${index}]" value="${start_date}" label="开始日期" name="milestones/milestone[${flag}${index}]/start_date" class="required date input_text dateCompare:milestone_end_date_[${flag}${index}] dateCompareAfterE:milestone_start_date_[${flag}${index}]:start_date"  style="width:70px" label="开始日期" />
            </td>
            <td align="center">&nbsp;
                <c:set var="end_date" scope="page"><x:out select="$milestone/end_date"/></c:set>
                <input  id="milestone_end_date_[${flag}${index}]" name="milestones/milestone[${flag}${index}]/end_date" label="结束日期" value="${end_date}" class="required date input_text dateCompareBeforeE:milestone_end_date_[${flag}${index}]:end_date" style="width:70px" label="结束日期" /> </td>
            <td>&nbsp;
                <textarea name="milestones/milestone[${flag}${index}]/content" class="input_textarea required maxlength:500" label="年度实施内容和考核指标" rows=5 cols=91><x:out select="$milestone/content"/></textarea>
                <input type="hidden" name="milestones/milestone[${flag}${index}]/content_hidden" id="milestones/milestone[${flag}${index}]/content_hidden" value="<x:out select="$milestone/content_hidden"/>"/>
            </td>
        </tr>
        <c:set value="${index+1}" var="index" scope="page"/>
    </x:forEach>
    <script type="text/javascript">
        showAllDateTag("tblMileStones");
    </script>
    </tbody>
</table>
<br>

<table width="98%" align="center">
    <tr ><td>
        <input class="button" name="cmdAddbefore" type=button value="添加" onclick="if(checkTabLimit('tblMileStones',8,'项目进度信息最多只能填写8条')){addNewRow('tblMileStones');showDateTag('tblMileStones');}try{top.resizeFrame();}catch(e){};">
        <!--
        <input class="button" name="cmdAddbefore" type=button value="添加" onclick="if(checkTabLimit('tblMileStones',5,'项目进度信息最多只能填写5条')){addNewRow('tblMileStones');}showDateTag('tblMileStones');try{top.resizeFrame();}catch(e){};">
        -->
        <input class="button" name="cmdMovePrev" type=button value="上移" onclick="movePrev('tblMileStones','selMileStones')">
        <input class="button" name="cmdMoveNext" type=button value="下移" onclick="moveNext('tblMileStones','selMileStones')">
        <input class="button" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('tblMileStones','项目进度计划')">
    </td></tr>
</table>


<script type="text/javascript">
    function formatVal(count) {
        if (!$.isNumeric(count))
            count = "0";
        count = ((parseFloat(count) * 10000) / 10000).toFixed(4);
        count = formatNumberAuto(count.toString(), 9, 2, 2);// 格式化金额
        return count;
    }
    function  count_tt(){
        var total1=0;
        var total2=0;
        $("#org_two_kjxm tr:eq(1) td:gt(1)").each(function(){
            var value=parseFloat($(this).find("input").val());
            if(!!!value){
                value=0;
            }
            total1=total1+value;
        });
        $("#org_two_kjxm tr:eq(2) td:gt(1)").each(function(){
            var value=parseFloat($(this).find("input").val());
            if(!!!value){
                value=0;
            }
            total2=total2+value;
        });
        $("#project_total").val(total1);
        $("#gon_pfund_total").val(formatVal(total2));
    }
</script>
